Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
@jalik/extend
Advanced tools
A utility to merge objects.
Useful when you need to merge two or more objects into one.
This library is tested with unit tests.
In this example, all objects are merged into the first object, so the first object is modified, if you don't want to modify the object, pass en empty object {}
as the first argument.
Note that objects are merged based on their order, so the 2nd object is merged in the first, then the 3rd is merged in the first, and so on... Keep in mind that first objects may be overridden by following objects.
import {extend} from "@jalik/extend";
const coldColors = {
blue: "#0000FF",
green: "#00FF00"
};
const hotColors = {
red: "#FF0000",
yellow: "#FFF000"
};
const customColors = {
cyan: "#5BF8FF",
pink: "#FF4CFB"
};
// Merge all colors in a new object
const mixedColors = extend({}, hotColors, coldColors, customColors);
In the previous example, all objects were flat, but it works also with deep objects and nested attributes.
import {extendRecursively} from "@jalik/extend";
const colorSet1 = {
cold: {
blue: "#0000FF",
green: "#00FF00"
},
hot: {
red: "#FF0000",
yellow: "#FFF000"
},
custom: {
cyan: "#5BF8FF",
pink: "#FF4CFB"
}
};
const colorSet2 = {
cold: {
blue: "#0011AA",
green: "#00AA11"
},
hot: {
red: "#AA0011",
yellow: "#AAA111"
}
};
// Merge all colors in a new object
const mixedColors = extendRecursively({}, colorSet1, colorSet2);
History of releases is in the changelog.
The code is released under the MIT License.
FAQs
A utility to merge flat objects.
We found that @jalik/extend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.